/**
 * @file com.demon.esport.admin.common.response
 * @CopyRight (C) www.10-game.com
 * @author jeffreychan
 * @email mebeyfeng@qq.com
 * @date 2018/10/18 22:59
 */

package com.demon.esport.admin.common.response;

import lombok.*;

import java.io.Serializable;

import static com.demon.esport.admin.common.constant.AdminConstant.FAILED_CODE;
import static com.demon.esport.admin.common.constant.AdminConstant.SUCCESS_CODE;

/**
 * @author: jeffreychan
 * @Date: 2018/10/18 22:59
 * @Description: 基础返回
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Response implements Serializable {

    private Integer code;

    private String message;

    private Long timestamp;

    private static Boolean rel = false;

    public Response success(String message) {
        Response response = new Response(SUCCESS_CODE, message, System.currentTimeMillis());
        return response;
    }

    public Response failed(String message) {
        Response response = new Response(FAILED_CODE, message, System.currentTimeMillis());
        return response;
    }
}
